import { AuthGuard } from '../../guard/auth.guard'
import { Inject, Controller ,Post ,Body, UseGuard} from '@midwayjs/decorator';
import { Context } from '@midwayjs/koa'
import { Role } from 'src/decorator/role.decorator';
import { AdminService } from 'src/service/admin.service';

/**
 * 描述
 */
 @UseGuard(AuthGuard)
@Controller('/admin')
export class APIController {
 @Inject()
  ctx: Context;
 @Inject()
AdminService: AdminService;

@Role(['admin'])
@Post('/addagent')
async addageent( @Body() body) {
        return this.AdminService.addagent(body)
  }
@Role(['admin'])
@Post('/getagent')
async getagent( ) {

        return this.AdminService.getagent()
  }


@Role(['admin'])
@Post('/settlement')
async settlement( @Body() body) {

        return this.AdminService.settlement(body)
  }

@Role(['admin'])
@Post('/extension')
async extension( @Body() body) {

        return this.AdminService.extension(body)
  }





}

